package com.wzh.mq.rabbit;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.HashMap;

/**
 * @author WZH
 * @title: Comsumer
 * @projectName find_house
 * @description:
 * @date 2022/3/23
 */
@Component
public class HouseConsumer {

    @RabbitListener(queues = "msg")
    public void take01(HashMap<String,Object> map, Message message, Channel channel) throws IOException {
        Integer houseId = (Integer) map.get("houseId");
        Integer status = (Integer) map.get("status");
        //todo 判断发短信

        channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
    }
}
